package com.tools.service.impl;


import com.tools.commons.utils.BeanUtils;
import com.tools.model.entity.PicsEntity;
import com.tools.model.entity.UserUploadPicEntity;
import com.tools.model.params.PicsParams;
import com.tools.repository.UserUploadPicRepository;
import com.tools.service.UserUpLoadService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class UserUpLoadServiceImpl implements UserUpLoadService {
    private final UserUploadPicRepository userUploadPicRepository;
    @Override
    public UserUploadPicEntity save(PicsParams picsParams) {
        UserUploadPicEntity picsEntity = new UserUploadPicEntity();
        BeanUtils.updateProperties(picsParams, picsEntity);
        return userUploadPicRepository.save(picsEntity);
    }
}
